function handleHttpResult(response) {
  return new Promise((resolve, reject) => {
    if (response.status === 200) {
      return resolve(response.data);
    }
    return reject(response);
  });
}

function handleResult(response) {
  return new Promise((resolve, reject) => {
    if (response.status !== '0') {
      return reject(response);
    }
    return resolve(response.body);
  });
}

export {
  handleHttpResult,
  handleResult,
};
export default {};
